home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb14.zip / TESTSIGC.PAS < prev    next >
Pascal/Delphi Source File  |  1985-05-17  |  2KB  |  58 lines

  1. (*--------------------------------------------------------------------------*)
  2. (*                 TestSigc --- Test chi-square significance routine        *)
  3. (*--------------------------------------------------------------------------*)
  4.  
  5. PROGRAM TestSigc;
  6.  
  7. (*--------------------------------------------------------------------------*)
  8. (*                                                                          *)
  9. (*   Program:  TestSigc                                                     *)
  10. (*                                                                          *)
  11. (*   Purpose:  Demonstrate chi-square significance routine in PIBSIGS.LBR   *)
  12. (*                                                                          *)
  13. (*   Usage:    This program prompts for a chi-square value and the          *)
  14. (*             corresponding degrees of freedom.  It computes and prints    *)
  15. (*             the significance level for the chi-square.                   *)
  16. (*             the given t value.                                           *)
  17. (*                                                                          *)
  18. (*             To stop the program, enter a negative chi-square value.      *)
  19. (*                                                                          *)
  20. (*   Calls:    SigChi                                                       *)
  21. (*                                                                          *)
  22. (*--------------------------------------------------------------------------*)
  23.  
  24. VAR
  25.    Chisq:    REAL;
  26.    Df:       REAL;
  27.    P:        REAL;
  28.    Done:     BOOLEAN;
  29.  
  30. (*$I SIGCONST.PAS *)
  31. (*$I LOGTEN.PAS   *)
  32. (*$I POWTEN.PAS   *)
  33. (*$I ALGAMA.PAS   *)
  34. (*$I GAMMAIN.PAS  *)
  35. (*$I SIGCHI.PAS   *)
  36.  
  37. BEGIN (* TestSigc *)
  38.  
  39.    Done := FALSE;
  40.    ClrScr;
  41.  
  42.    REPEAT
  43.  
  44.       WRITE('Enter Chi-square value and degrees of freedom (-99 to stop): ');
  45.       READLN( Chisq, Df );
  46.  
  47.       IF ( Chisq > 0.0 ) THEN
  48.          BEGIN
  49.             P     := Sigchi( Chisq, Df );
  50.             WRITELN('Significance of chi-square = ',P:8:5);
  51.          END
  52.       ELSE
  53.          Done := TRUE;
  54.  
  55.    UNTIL Done;
  56.  
  57.  
  58. END   (* TestSigc *).